POV-Ray : Newsgroups : povray.programming : A thought for 4.0 : A thought for 4.0 Server Time
28 Jul 2024 08:29:25 EDT (-0400)
  A thought for 4.0  
From: David McCabe
Date: 19 Sep 2002 01:18:05
Message: <3d895e0d@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

I don't know how far you are in the design process for 4.0, but assuming not 
very far at all, I just had an idea that you might like.

Rather then having some weird, limited, language with a lot of code to 
maintain, why not use some full-blown standard scripting language for scene 
description? We could have some API that the user would talk to in order to 
tell POV-Ray what stuff to put in the scene, just as we have language 
directives now.

This has several advantages:
1. The user gets a real scripting language that can do any kind of 
        calculations or functions or whatever, and can even integrate
        rendering with other tasks, automating something or other.
2. The user doesn't have to learn a new language, just a new API.
3. You get a high-quality interpeter for free. This would greatly reduce
        the size of POV-Ray, etc.

By choosing a language that has object-oriented features, you allow users
to do all kinds of fun stuff. At present, we have '.inc' files with
macros in them to do things. Put if they had classes in them, that
knew how to do things, such as animating themselves, or interacting
with others, the door is opened to many interesting and usefull
possibilities. Imagine describing large scenes in terms of high-level
objects that interacted and animated themeselves based on internal 
procedures. The possibilities here are great.

But I digress. Of course, that which I have just briefly described could be 
accomplished using a specialized language. The advantage of a normal 
language is that everyone gets stuff for free.

Anyway, my nominations for the language are (in this order):

1. Ruby
2. Python
3. Java

Look at his hypothetical Ruby snippet:


add Camera.new Vector.new(3,5,-10), Vector.new(0,0,0)
add PointLightSource.new Vector.new(30,30,-30), White.vector
add Plane.new x, -2, Texture.new( CheckerPigment(Black.vector,Red.vector) )
add Sphere.new Vector.new(0,0,0), 2, Texture.new(Yellow.pigment)
add SkySphere.new( GradientPigment( y, Colormap.new([0,SkyBlue.vector], \
        [1,Blue.vector])))
render


...Hmm, that looks a bit clunky; we'll try getting rid of the Vectors...


add Camera.new 3,5,-10, 0,0,0
add PointLightSource.new 30,30,-30, White
add Plane.new x, -2, Texture.new( CheckerPigment(Black,Red) )
add Sphere.new 0,0,0, 2, Texture.new( ColorPigment(Yellow) )
add SkySphere.new( GradientPigment( y, [0=>SkyBlue,1=>Blue] ) )
render

...rather than:


camera
{
        location <3,5,-10>
        look_at <0,0,0>
}

light_source
{
        <30,30,-30>,
        color White
}

plane
{
        x,-2
        texture
        {
                pigment{ checker Black Red }
        }
}

sphere
{
        <0,0,0>,2
        texture
        {
                pigment{ color Yellow }
        }
}

skysphere
{
        pigment
        {
                gradient y
                color_map
                {
                        [0 color SkyBlue]
                        [1 color Blue]
                }
        }
}

...Anyway, you get the idea of what it would look like. But it's really 
about being able to do any sort of task or calculation when making the 
scene.


Well, maybe you've all just been enlightened with a blinding stroke of 
genius, or maybe someone else has already suggested this, or maybe it's the 
stupidest thing ever. Anyhoo, I thought I'd mention it to you who know more 
than I do. Thanks for listening.

- -- 
David McCabe
http://12.225.144.95/pgpkey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9iV801bgGCL1rO04RAtLIAKDJqYTkESKHd36pK3xmkHDvsZy5gwCfc4XC
jSWQUlpGu/fRVqHJkFZJpKA=
=ZZQk
-----END PGP SIGNATURE-----


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.